home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak Vol A-4
/
(Vol A-4) Vol. A4.iso
/
Games
/
the-kitchen-of-doom.swf
/
scripts
/
DefineSprite_671
/
frame_1
/
DoAction.as
Wrap
Text File
|
2008-03-14
|
938b
|
51 lines
function setFps(newFps)
{
fps = newFps;
}
function start()
{
isRunning = true;
}
function stop()
{
isRunning = false;
}
function reset()
{
ticks = 0;
Value.text = "00:00.00";
}
function getTime()
{
return Math.round(ticks / fps * 1000);
}
isRunning = false;
ticks = 0;
fps = 18;
onEnterFrame = function()
{
if(isRunning)
{
ticks++;
var _loc1_ = ticks;
var _loc2_ = Math.floor(_loc1_ / (fps * 60));
if(_loc2_ < 10)
{
_loc2_ = "0" + _loc2_;
}
_loc1_ -= _loc2_ * (fps * 60);
var _loc3_ = Math.floor(_loc1_ / fps);
if(_loc3_ < 10)
{
_loc3_ = "0" + _loc3_;
}
_loc1_ -= _loc3_ * fps;
var hundreds = Math.floor(_loc1_ / fps * 100);
if(hundreds < 10)
{
hundreds = "0" + hundreds;
}
Value.text = _loc2_ + ":" + _loc3_ + "." + hundreds;
}
};